<?php

class Load {
	function view( $file_name, $data = null )
	{
		if( is_array($data) ) {
			extract($data);
		}
                if (isset($redirect) and $redirect === true)
                {
                    header("refresh: 3; index.php");
                }
                else if (isset($redirect) and is_int($redirect))
                {
                    header("refresh: $redirect; index.php");
                }
		include 'views/head.php';
		include 'views/' . $file_name;
		include 'views/foot.php';
	}
}



